home *** CD-ROM | disk | FTP | other *** search
/ Developer Helper 1: Phil & Dave's Excellent CD / Excellent CD HFS.raw / HyperCard / HyperCard 1.2.2 International / HyperCard Danish (DK-1.2.2) / Idestakke / Baggrundsideer / background_50429.txt < prev    next >
Text File  |  1988-12-19  |  11KB  |  475 lines

  1. -- background: 50429 from stack: in
  2. -- bmap block id: 35063
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on newStack
  8.   extend
  9. end newStack
  10.  
  11. on extend
  12.   -- type "udvid" into the message box and press return to make
  13.   -- a year's worth of new cards.
  14.   if the name of this stack contains "Baggrundsideer"
  15.   then
  16.   answer "Opret venligst en ny stak, f√∏r den udvides." with "OK"
  17. else
  18.   answer "Skal der laves kort til et nyt √•r?" with "OK" or "Annuller"
  19.   if it is "Annuller" then exit extend
  20.   put 60*60*24 into OneDay        --seconds in a day
  21.   go to last card of this background
  22.   put getStartDate() into start      --what date to begin on
  23.   if start is "Annuller" then exit extend
  24.   put start into it        --a copy
  25.   convert it to long date
  26.   global calcMonth
  27.   put word 1 of item 2 of it into calcMonth
  28.   set name of this bkgnd to calcMonth
  29.   repeat with cnt = 1 to 53   --weeks in a year
  30.     put start into it        --a copy
  31.     convert it to long date
  32.     delete item 1 of it   -- get rid of "Mandag,"
  33.     put it into field "Uge"
  34.  
  35.     Repeat with index = 1 to 7
  36.       put word index of ("Mandag Tirsdag Onsdag Torsdag" && "Fredag L√∏rdag S√∏ndag") into myDay
  37.       put start into it
  38.       --convert each day so that date rolls over to "1"
  39.       --at end of month
  40.       convert it to long date
  41.       put (word 2 of item 2 of it) into field myDay
  42.       add OneDay to start
  43.     end repeat
  44.     doMenu New Card
  45.     upDateBkgnd start  --make a new background if new month
  46.   end repeat
  47.   doMenu "delete card"     --get rid of extra card at end
  48. end if
  49. end extend
  50.  
  51. on upDateBkgnd start
  52.   global calcMonth
  53.   put start into it        --a copy
  54.   convert it to long date
  55.   if word 1 of item 2 of it <> calcMonth then   --if new month
  56.     --create a new background.
  57.     put word 1 of item 2 of it into calcMonth
  58.     doMenu "Cut Card"    --new bkgnd is a copy with only name changed
  59.     go previous card
  60.     put the long name of this card into goodStack
  61.     set lockScreen to true
  62.     go to stack "home"
  63.     --must go to another stack to avoid changing the original bkgnd
  64.     doMenu "Paste Card"
  65.     set name of this background to word 1 of item 2 of it
  66.     doMenu "Cut Card"
  67.     go goodStack
  68.     set lockScreen to false
  69.     doMenu "Paste Card"
  70.     set name of this bkgnd to calcMonth
  71.   end if
  72. end upDateBkgnd
  73.  
  74. function getStartDate
  75. -- end of stack or today, whichever is newer
  76. get field "Uge"
  77. if it is empty then put the date into it
  78. put startOfWeek(it) into it    --so we can compare
  79. put the date into thisWeek
  80. put startOfWeek(thisWeek) into thisWeek    --both at week starts in seconds
  81. if thisWeek < 2587766400 then
  82.   answer "Indstil Kontrolpanelet til dags dato" with "OK"
  83.   return "Annuller"
  84. end if
  85. if it >= thisWeek then return it   --calendar already beyond today
  86. convert it to short date
  87. convert thisWeek to short date
  88. answer "Startende fra hvilken dato?" with it or thisWeek or "Annuller"
  89. if it is "Annuller" then return it
  90. convert it to seconds
  91. return it
  92. end getStartDate
  93.  
  94. function startOfWeek aDate     -- the seconds for the start of this week
  95. put 60*60*24 into OneDay      --seconds in a day
  96. put aDate into it
  97. convert it to long date
  98. repeat while item 1 of it <> "Mandag"
  99.   convert it to seconds
  100.   subtract OneDay from it
  101.   convert it to long date
  102. end repeat
  103. convert it to seconds
  104. return it
  105. end startOfWeek
  106.  
  107.  
  108.  
  109. on openBackground
  110.   push recent card
  111. end openBackground
  112.  
  113.  
  114. -- part 2 (field)
  115. -- low flags: 00
  116. -- high flags: 4000
  117. -- rect: left=33 top=57 right=131 bottom=176
  118. -- title width / last selected line: 0
  119. -- icon id / first selected line: 0 / 0
  120. -- text alignment: 0
  121. -- font id: 20
  122. -- text size: 12
  123. -- style flags: 0
  124. -- line height: 12
  125. -- part name: 
  126.  
  127.  
  128. -- part 3 (field)
  129. -- low flags: 00
  130. -- high flags: 4000
  131. -- rect: left=183 top=57 right=131 bottom=326
  132. -- title width / last selected line: 0
  133. -- icon id / first selected line: 0 / 0
  134. -- text alignment: 0
  135. -- font id: 20
  136. -- text size: 12
  137. -- style flags: 0
  138. -- line height: 12
  139. -- part name: 
  140.  
  141.  
  142. -- part 4 (field)
  143. -- low flags: 00
  144. -- high flags: 4000
  145. -- rect: left=333 top=57 right=131 bottom=476
  146. -- title width / last selected line: 0
  147. -- icon id / first selected line: 0 / 0
  148. -- text alignment: 0
  149. -- font id: 20
  150. -- text size: 12
  151. -- style flags: 0
  152. -- line height: 12
  153. -- part name: 
  154.  
  155.  
  156. -- part 5 (field)
  157. -- low flags: 00
  158. -- high flags: 4000
  159. -- rect: left=33 top=155 right=229 bottom=176
  160. -- title width / last selected line: 0
  161. -- icon id / first selected line: 0 / 0
  162. -- text alignment: 0
  163. -- font id: 20
  164. -- text size: 12
  165. -- style flags: 0
  166. -- line height: 12
  167. -- part name: 
  168.  
  169.  
  170. -- part 6 (field)
  171. -- low flags: 00
  172. -- high flags: 4000
  173. -- rect: left=183 top=155 right=229 bottom=326
  174. -- title width / last selected line: 0
  175. -- icon id / first selected line: 0 / 0
  176. -- text alignment: 0
  177. -- font id: 20
  178. -- text size: 12
  179. -- style flags: 0
  180. -- line height: 12
  181. -- part name: 
  182.  
  183.  
  184. -- part 7 (field)
  185. -- low flags: 00
  186. -- high flags: 4000
  187. -- rect: left=333 top=155 right=229 bottom=476
  188. -- title width / last selected line: 0
  189. -- icon id / first selected line: 0 / 0
  190. -- text alignment: 0
  191. -- font id: 20
  192. -- text size: 12
  193. -- style flags: 0
  194. -- line height: 12
  195. -- part name: 
  196.  
  197.  
  198. -- part 8 (field)
  199. -- low flags: 00
  200. -- high flags: 0000
  201. -- rect: left=114 top=33 right=56 bottom=148
  202. -- title width / last selected line: 0
  203. -- icon id / first selected line: 0 / 0
  204. -- text alignment: 0
  205. -- font id: 20
  206. -- text size: 18
  207. -- style flags: 0
  208. -- line height: 24
  209. -- part name: Mandag
  210.  
  211.  
  212. -- part 9 (field)
  213. -- low flags: 00
  214. -- high flags: 0000
  215. -- rect: left=256 top=32 right=55 bottom=290
  216. -- title width / last selected line: 0
  217. -- icon id / first selected line: 0 / 0
  218. -- text alignment: 0
  219. -- font id: 20
  220. -- text size: 18
  221. -- style flags: 0
  222. -- line height: 24
  223. -- part name: Tirsdag
  224.  
  225.  
  226. -- part 10 (field)
  227. -- low flags: 00
  228. -- high flags: 0000
  229. -- rect: left=410 top=32 right=55 bottom=444
  230. -- title width / last selected line: 0
  231. -- icon id / first selected line: 0 / 0
  232. -- text alignment: 0
  233. -- font id: 20
  234. -- text size: 18
  235. -- style flags: 0
  236. -- line height: 24
  237. -- part name: Onsdag
  238.  
  239.  
  240. -- part 11 (field)
  241. -- low flags: 00
  242. -- high flags: 0000
  243. -- rect: left=114 top=129 right=152 bottom=148
  244. -- title width / last selected line: 0
  245. -- icon id / first selected line: 0 / 0
  246. -- text alignment: 0
  247. -- font id: 20
  248. -- text size: 18
  249. -- style flags: 0
  250. -- line height: 24
  251. -- part name: Torsdag
  252.  
  253.  
  254. -- part 12 (field)
  255. -- low flags: 00
  256. -- high flags: 0000
  257. -- rect: left=253 top=130 right=153 bottom=287
  258. -- title width / last selected line: 0
  259. -- icon id / first selected line: 0 / 0
  260. -- text alignment: 0
  261. -- font id: 20
  262. -- text size: 18
  263. -- style flags: 0
  264. -- line height: 24
  265. -- part name: Fredag
  266.  
  267.  
  268. -- part 13 (field)
  269. -- low flags: 00
  270. -- high flags: 0000
  271. -- rect: left=363 top=131 right=154 bottom=397
  272. -- title width / last selected line: 0
  273. -- icon id / first selected line: 0 / 0
  274. -- text alignment: 0
  275. -- font id: 20
  276. -- text size: 18
  277. -- style flags: 0
  278. -- line height: 24
  279. -- part name: Lørdag
  280.  
  281.  
  282. -- part 14 (field)
  283. -- low flags: 00
  284. -- high flags: 0000
  285. -- rect: left=435 top=130 right=153 bottom=469
  286. -- title width / last selected line: 0
  287. -- icon id / first selected line: 0 / 0
  288. -- text alignment: 0
  289. -- font id: 20
  290. -- text size: 18
  291. -- style flags: 0
  292. -- line height: 24
  293. -- part name: Søndag
  294.  
  295.  
  296. -- part 16 (field)
  297. -- low flags: 00
  298. -- high flags: 0000
  299. -- rect: left=330 top=247 right=268 bottom=478
  300. -- title width / last selected line: 0
  301. -- icon id / first selected line: 0 / 0
  302. -- text alignment: 1
  303. -- font id: 20
  304. -- text size: 18
  305. -- style flags: 0
  306. -- line height: 24
  307. -- part name: Uge
  308.  
  309.  
  310. -- part 17 (button)
  311. -- low flags: 00
  312. -- high flags: 0000
  313. -- rect: left=446 top=274 right=304 bottom=484
  314. -- title width / last selected line: 0
  315. -- icon id / first selected line: 11045 / 11045
  316. -- text alignment: 1
  317. -- font id: 0
  318. -- text size: 12
  319. -- style flags: 0
  320. -- line height: 16
  321. -- part name: Hjem
  322. ----- HyperTalk script -----
  323. on mouseUp
  324.   visual effect iris close
  325.   go "Home"
  326. end mouseUp
  327.  
  328.  
  329.  
  330. -- part 18 (button)
  331. -- low flags: 00
  332. -- high flags: 0000
  333. -- rect: left=375 top=274 right=305 bottom=410
  334. -- title width / last selected line: 0
  335. -- icon id / first selected line: 30696 / 30696
  336. -- text alignment: 1
  337. -- font id: 0
  338. -- text size: 12
  339. -- style flags: 0
  340. -- line height: 16
  341. -- part name: Telefon
  342. ----- HyperTalk script -----
  343. on mouseUp
  344.   get the selection
  345.   if it is empty then get the message
  346.   if it is empty then ask "Ring til hvilket nummer?"
  347.   if it is not empty then
  348.     dial it
  349.   end if
  350. end mouseUp
  351.  
  352.  
  353.  
  354. -- part 19 (button)
  355. -- low flags: 00
  356. -- high flags: 0000
  357. -- rect: left=411 top=274 right=305 bottom=445
  358. -- title width / last selected line: 0
  359. -- icon id / first selected line: 0 / 0
  360. -- text alignment: 1
  361. -- font id: 0
  362. -- text size: 12
  363. -- style flags: 0
  364. -- line height: 16
  365. -- part name: Kalender
  366. ----- HyperTalk script -----
  367. on mouseUp
  368.   set lockscreen to true
  369.   go to "Kalender"
  370.   goSixMonthly the seconds
  371. end mouseUp
  372.  
  373.  
  374.  
  375. -- part 20 (button)
  376. -- low flags: 00
  377. -- high flags: 0000
  378. -- rect: left=341 top=275 right=305 bottom=374
  379. -- title width / last selected line: 0
  380. -- icon id / first selected line: 0 / 0
  381. -- text alignment: 1
  382. -- font id: 0
  383. -- text size: 12
  384. -- style flags: 0
  385. -- line height: 16
  386. -- part name: Adresse
  387. ----- HyperTalk script -----
  388. on mouseUp
  389.   get the selection
  390.   visual effect zoom open
  391.   go to "Adresse"
  392.   if it is not empty then find it
  393. end mouseUp
  394.  
  395.  
  396.  
  397. -- part 22 (button)
  398. -- low flags: 00
  399. -- high flags: 0000
  400. -- rect: left=444 top=317 right=333 bottom=485
  401. -- title width / last selected line: 0
  402. -- icon id / first selected line: 6720 / 6720
  403. -- text alignment: 1
  404. -- font id: 0
  405. -- text size: 12
  406. -- style flags: 0
  407. -- line height: 16
  408. -- part name: Return
  409. ----- HyperTalk script -----
  410. on mouseUp
  411.   visual effect iris close
  412.   pop card
  413. end mouseUp
  414.  
  415.  
  416.  
  417. -- part 23 (button)
  418. -- low flags: 00
  419. -- high flags: 0000
  420. -- rect: left=224 top=315 right=338 bottom=252
  421. -- title width / last selected line: 0
  422. -- icon id / first selected line: 15420 / 15420
  423. -- text alignment: 1
  424. -- font id: 0
  425. -- text size: 12
  426. -- style flags: 0
  427. -- line height: 16
  428. -- part name: 
  429. ----- HyperTalk script -----
  430. on mouseUp
  431.   visual effect wipe right
  432.   go to prev card
  433. end mouseUp
  434.  
  435.  
  436.  
  437.  
  438. -- part 24 (button)
  439. -- low flags: 00
  440. -- high flags: 0000
  441. -- rect: left=267 top=315 right=338 bottom=294
  442. -- title width / last selected line: 0
  443. -- icon id / first selected line: 16560 / 16560
  444. -- text alignment: 1
  445. -- font id: 0
  446. -- text size: 12
  447. -- style flags: 0
  448. -- line height: 16
  449. -- part name: 
  450. ----- HyperTalk script -----
  451. on mouseUp
  452.   visual effect wipe left
  453.   go to next card
  454. end mouseUp
  455.  
  456.  
  457.  
  458. -- part 25 (button)
  459. -- low flags: 00
  460. -- high flags: 8004
  461. -- rect: left=387 top=318 right=333 bottom=433
  462. -- title width / last selected line: 0
  463. -- icon id / first selected line: 0 / 0
  464. -- text alignment: 1
  465. -- font id: 3
  466. -- text size: 9
  467. -- style flags: 0
  468. -- line height: 12
  469. -- part name: Udvid
  470. ----- HyperTalk script -----
  471. on mouseUp
  472.   extend
  473. end mouseUp
  474.  
  475.